//index.js
//获取应用实例
const app = getApp()
const utils = require('../../utils/util.js');
const postsData = require('../../data/index-data.js');
Page({
    data: {
        imagesData: [
            '/pages/images/banner/wx.png',
            '/pages/images/banner/vr.png',
            '/pages/images/banner/iqiyi.png'
        ],
        indicatorDots: true,
        autoPlay: true,
        circular: true,
        interval: 5000,
        duration: 300
    },
    //事件函数
    onLoad() {
        this.getDataList()
    },
    getDataList() {
        this.setData({
            postList: postsData.postList
        })
    },
    onPostTap(event) {
        const postId = event.currentTarget.dataset.postid;
        wx.navigateTo({
            url: 'index-detail/index-detail?id='+postId,
        })
    }
})